<!DOCTYPE html>
<html xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <title>物流付款确认</title>
    <#include "/header.html">
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn" style="font-size: 12px">
            <form class="form-inline" role="form">
                <a class="btn btn-default btn-sm" @click="reset"><i class="fa fa-refresh"></i></a>

                <a class="btn btn-danger btn-sm"  @click="batchPayment">批量付款</a>
                <a class="btn btn-danger btn-sm"  @click="batchAudit">批量审核</a>

                <div class="form-group">
                    <input type="text" class="form-control input-sm" v-model="q.orderNo" @keyup.enter="query" placeholder="订单号">
                </div>&nbsp;&nbsp;&nbsp;
                <div class="form-group">
                    <input type="text" class="form-control input-sm" v-model="q.logisticsName" @keyup.enter="query" placeholder="物流名称">
                </div>&nbsp;&nbsp;&nbsp;
                <div class="form-group">
                    <!--<input type="text" class="form-control input-sm" v-model="q.orderNo" @keyup.enter="query" placeholder="订单来源">-->
                    <el-select v-model="q.sellerId" filterable placeholder="订单来源" size="mini">
                        <el-option  v-for="item in e.merchantList"  :key="item.sellerId"  :label="item.sellerName" :value="item.sellerId">  </el-option>
                    </el-select>
                </div>&nbsp;&nbsp;&nbsp;
                <div class="form-group">
                    <input type="text" class="form-control input-sm" v-model="q.logiNo" @keyup.enter="query" placeholder="物流单号">
                </div>&nbsp;&nbsp;&nbsp;
                <div class="form-group">
                    <input type="number" class="form-control input-sm" v-model="q.beginLogiCost" style="width: 120px;" @keyup.enter="query" placeholder="物流金额"/>
                    至
                    <input type="number" class="form-control input-sm" v-model="q.endLogiCost" style="width: 120px;"@keyup.enter="query" placeholder="物流金额"/>
                </div>&nbsp;&nbsp;&nbsp;
                <div class="form-group">
                    <input class="form-control input-sm" v-model="q.beginCreatetime" style="width: 120px;" @keyup.enter="query" @click = "checkBeginDate" placeholder="开始时间"/>
                    至
                    <input class="form-control input-sm" v-model="q.endCreatetime" style="width: 120px;"@keyup.enter="query" @click = "checkEndDate" placeholder="结束时间"/>
                </div>&nbsp;&nbsp;&nbsp;
                <div class="form-group">
                    <!--<label>审核状态：</label>-->
                    <!--<select class="form-control input-sm" v-model="q.orderNo" @keyup.enter="query">-->
                        <!--<option value="">全部</option>-->
                    <!--</select>-->
                    <el-select v-model="q.logisticFinanceStatus" filterable placeholder="审核状态" size="mini">
                        <el-option  v-for="item in e.logisticFinanceStatusList"
                                    :key="item.id"  :label="item.describe" :value="item.id">  </el-option>
                    </el-select>
                </div>&nbsp;&nbsp;&nbsp;
                <a class="btn btn-default btn-sm"  @click="query"><i class="fa fa-search"></i>&nbsp;查询</a>
            </form>
        </div>
        <div>
            <el-table ref="multipleTable" @selection-change="handleSelectionChange" :data="page.tableData"  border  style="width: 100%" size="mini">
                <el-table-column
                        type="selection"
                        width="55">
                </el-table-column>
                <el-table-column prop="" label="操作" width="250" align="center">
                    <template slot-scope="scope">
                        <label v-if="scope.row.logisticFinanceStatus == 2">—</label>
                        <el-button size="mini" v-if="scope.row.logisticFinanceStatus == -1 || scope.row.logisticFinanceStatus == 0" @click="costFormVisible = true,costForm.logiId = scope.row.logiId, costForm.logiCost = scope.row.logiCost,costForm.logisticsName = scope.row.logisticsName,costForm.logiNo = scope.row.logiNo">录入成本</el-button>
                        <el-button size="mini" v-if="scope.row.logisticFinanceStatus == 0" @click="audit(scope.$index, scope.row)">审核</el-button>
                        <el-button size="mini" v-if="scope.row.logisticFinanceStatus == 1" @click="payView(scope.row)">付款</el-button>
                        <el-button size="mini" v-if="scope.row.logisticFinanceStatus == 0 || scope.row.logisticFinanceStatus == 1" @click="back(scope.$index, scope.row)">弃审</el-button>
                        <el-button size="mini" v-if="scope.row.logisticFinanceStatus != 2" @click="deleteLogi(scope.row.logiId)">删除</el-button>
                    </template>
                </el-table-column>
                <el-table-column prop="orderId" label="订单号" min-width="100" align="center"> </el-table-column>
                <el-table-column prop="sellerName" label="来源" min-width="70"  align="center"> </el-table-column>
                <el-table-column prop="logisticFinanceStatus" min-width="70" label="审核状态"  :formatter="formatFinanceStatus" align="center"></el-table-column>
                <el-table-column prop="sendType" label="发货方式" min-width="70"  :formatter="formatSendType" align="center"></el-table-column>
                <el-table-column prop="logisticsName" label="物流名称" min-width="70" align="center"> </el-table-column>
                <el-table-column prop="logiNo" label="物流单号" min-width="70" align="center"> </el-table-column>
                <el-table-column prop="logiCost" label="物流金额" min-width="60"  align="center"> </el-table-column>
                <el-table-column prop="sendTime" label="发货时间" min-width="100"  align="center"> </el-table-column>
                <el-table-column prop="logiRemark" label="物流备注" min-width="200"  align="center"> </el-table-column>
                <el-table-column prop="logiPaytime" label="付款时间" align="center"> </el-table-column>
                <el-table-column prop="logiPayRemark" label="付款备注" align="center"> </el-table-column>
            </el-table>
            <div class="block text-right">
                <el-pagination
                        @size-change="handleSizeChange"
                        @current-change="handleCurrentChange"
                        :current-page="1"
                        :page-sizes="[page.pageSize, 2*page.pageSize, 4*page.pageSize]"
                        :page-size="page.pageSize"
                        layout="total, sizes, prev, pager, next, jumper"
                        :total="page.totalCount">
                </el-pagination>
            </div>
        </div>
    </div>

    <!-- 付款弹框 -->
    <el-dialog title="支付信息" :visible.sync="dialogFormVisible" width="420px">
        <el-form :model="form">
            <el-form-item label="物流金额" label-width="80px">
                {{form.logiCost}}
            </el-form-item>
            <el-form-item label="付款日期" label-width="80px">
                <el-date-picker  v-model="form.logiPaytime"  type="date"  placeholder="选择日期" format="yyyy 年 MM 月 dd 日" style="width: 300px;"></el-date-picker>
            </el-form-item>
            <el-form-item label="付款备注" label-width="80px">
                <el-input v-model="form.logiPayRemark" type="textarea" :autosize="{ minRows: 2, maxRows: 6}" placeholder="请输入备注信息">
                </el-input>
            </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button type="primary" @click="payConfirm" size="mini">确 定</el-button>
            <el-button @click="dialogFormVisible = false" size="mini">取 消</el-button>
        </div>
    </el-dialog>

    <!-- 录入成本弹框 -->
    <el-dialog title="物流成本" :visible.sync="costFormVisible" width="420px">
        <el-form :model="costForm">
            <el-form-item label="物流成本" label-width="80px">
                <el-input-number v-model="costForm.logiCost" :precision="2" :step="1" :max="100000"></el-input-number>
            </el-form-item>
            <el-form-item label="物流名称" label-width="80px">
                <el-select v-model="costForm.logisticsName" placeholder="请选择">
                    <el-option
                            v-for="item in logisticsTypeEntityList"
                            :key="item.logisticsId"
                            :label="item.logisticsName"
                            :value="item.logisticsName">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="物流单号" label-width="80px">
                <el-input v-model="costForm.logiNo"></el-input>
            </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button type="primary" @click="enteringCost" size="mini">确 定</el-button>
            <el-button @click="costFormVisible = false" size="mini">取 消</el-button>
        </div>
    </el-dialog>
</div>
<script src="${request.contextPath}/statics/js/modules/finance/logisticsMoney.js?_${.now?long}"></script>
</body>
</html>
